import request from '@u/request'
// 请求商品列表
const fetchItems = (params = {}) => {
  return request.get('/itemLists', {params})
}
// 新增商品
const addItem = (params  = {}) => (
  request.post('/addItem', params)
)
// 获取商品 
const fetchItemDetail = (id: string) => {
  return request.get('/itemDetail', {params: {id}})
}
// 修改商品
const updateItem = (params  = {}) => (
  request.put('/updateItem', params)
)
export {
  fetchItems,
  addItem,
  fetchItemDetail,
  updateItem
}